import {
  Loading, Message, MessageBox, Dialog, Button, Input, ColorPicker, Divider, Slider, Upload, Select, Option, Form, FormItem, Tooltip, Popover, Dropdown, DropdownMenu, DropdownItem, Progress, Image, DatePicker, Carousel, CarouselItem, Rate, Table, TableColumn, Pagination, Switch, Checkbox, CheckboxGroup
} from 'element-ui'
const arr = [
  Dialog, Button, Input, ColorPicker, Divider, Slider, Upload, Select, Option, Form, FormItem, Tooltip, Popover, Dropdown, DropdownMenu, DropdownItem, Progress, Image, DatePicker, Carousel, CarouselItem, Rate, Table, TableColumn, Pagination, Switch, Checkbox, CheckboxGroup
]
export default {
  install: function (Vue) {
    arr.map(component => {
      if (component.name) {
        // Vue.use(component) // message会出现空白提示信息
        Vue.component(component.name, component)
      }
    })
    Vue.use(Loading.directive)
    Vue.component(Message.name, Message)
    Vue.prototype.$loading = Loading.service
    Vue.prototype.$message = Message
    Vue.prototype.$confirm = MessageBox.confirm
  }
}
